// 组织架构相关的接口
import request from '@/utils/request'
// 获取部门列表
export const reqGetDeptsList = () => request({
  method: 'get',
  url: '/company/department'
})
// 删除部门
export const reqDelDept = (id) => request({
  method: 'delete',
  url: `/company/department/${id}`
})
// 新增部门
export const reqAddDept = data => request({
  method: 'post',
  url: `/company/department`,
  data
})

// 根据id获取部门信息
export const reqGetDeptInfoById = (id) => request(({
  method: 'get',
  url: `/company/department/${id}`
}))

// 更新部门信息
// put请求携带请求体和post一样
export const reqUpdateDept = (data) => request({
  method: 'put',
  url: `/company/department/${data.id}`,
  data
})
